import service from '@/utils/axios'
export const GET_VIEW_LIST = () => {
  return service({
    url: '/api/v1/view',
    method: 'get'
  })
}
export interface IView {
  view_authority_text: string
  view_name: string
  view_icon?: string
  view_level?: string
  view_authority_pid: string
  id?: string
}
export const ADD_VIEW = (data: IView) => {
  return service({
    url: '/api/v1/view',
    method: 'post',
    data
  })
}
export const GET_VIEW = (id: string) => {
  return service({
    url: `/api/v1/view/${id}`,
    method: 'get'
  })
}
export const UPDATE_VIEW = ({ id, ...data }: IView) => {
  return service({
    url: `/api/v1/view/${id}`, // restful
    method: 'put',
    data
  })
}
export const DELETE_VIEW = (id: string) => {
  return service({
    url: `/api/v1/view/${id}`,
    method: 'delete'
  })
}
